<template>
	<BaseContainer>
		<el-tabs tab-position="left" v-model="activeName">
			<el-tab-pane v-for="(item, index) in tabsList" :key="index" :label="item.label" :name="item.value"></el-tab-pane>
				<serviceFacility
				v-if="activeName == 4"
				:tableConfig="tableAidConfig('社区老年人认知障碍照护服务中心')"
				:searchConfig="searchAidConfig('社区老年人认知障碍照护服务中心')"
				:isComprehensiveQueries="false"
				:needPigeonhole="false"
				:moreSearchConfig="''"
				:formConfig="facilityFormConfig({type: '9'})"
				:paramsObj="{
					type: '9',
				}"
        importModeTitle="社区老年人认知障碍照护服务中心"
			></serviceFacility>
			<aplid-base-crud
				v-else
				:key="activeName"
				ref="crud"
				class="w-100"
				v-bind="activeItem.baseConfig"
				:paramsObj="{ ...(activeItem.paramsObj || {}), ...(activeItem.baseConfig.paramsObj || {}) }"
			>
				<template v-slot:pageName></template>
			</aplid-base-crud>
		</el-tabs>
	</BaseContainer>
</template>

<script setup>
import { baseConfig as PolicyDocuments } from '../common/dpWorkPlan'
import { baseConfig as TargetValue } from '../elderlyReform/TargetValue'
import serviceFacility from '@/views/datacenter/basicData/serviceFacility/index.vue'
import { searchAidConfig, tableAidConfig,facilityFormConfig } from '../common/config'

const activeName = ref(1)
const tabsList = [
	{
		label: '工作方案',
		value: 1,
		baseConfig: PolicyDocuments,
		paramsObj: {
			type: 3,
			typeLabel: '新建12个社区老年人认知障碍照护服务中心工作方案（区）',
		},
	},

	{ label: '老年人认知障碍照护服务中心', value: 4 },
	// {
	// 	label: '目标值',
	// 	value: 5,
	// 	baseConfig: TargetValue,
	// 	paramsObj: {
	// 		contentType: '5',
	// 		contentTypeLabel: '新建社区老年人认知障碍照护服务中心目标值',
	// 	},
	// },
]

const activeItem = computed(() => {
	return tabsList.find((item) => item.value === activeName.value) || {}
})
</script>

<style lang="scss" scoped></style>
